using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FiltronASP.Modules.Abstracts;
using FiltronASP.Models.DAO.Interfaces;
using System.Web.UI.WebControls;
using FiltronASP.Models;
using FiltronASP.Models.DAO.Filtron;
using FiltronASP.Helpers.CatalogueMenu;
using FiltronASP.Helpers.Translations;

namespace FiltronASP.Modules
{
    public class replacementsCarsSearchModuleFiltron : AbstractModule
    {
        private Page currentPage;

        /// <summary>
        /// Klasa odpowiedzialna za generowanie contentu przez modul.
        /// </summary>
        /// <param name="page">biezaca strona</param>
        /// <returns>content</returns>
        public override string GenerateContent(FiltronASP.Models.Page page)
        {
            this.currentPage = page;
            string htmlToReturn = "";
            int pageId = page.page_id;
            int languageId = Convert.ToInt32(page.language_id);
            htmlToReturn += this.generateVehiclesMenu(languageId, pageId);

            return htmlToReturn;
        }

        private string generateVehiclesMenu(int languageId, int pageId)
        {
            string htmlToReturn = "";
            htmlToReturn += "<div class='no-padding col-lg-9 col-md-8 col-sm-12 col-xs-12'>";
            htmlToReturn += "<div class='col-md-6 col-sm-6  col-xs-12 kat-sub-select mar-top-20'>";
            htmlToReturn += "<div class='col-xs-12 padding-0' id='replacementsFilterTextInput'>";
            htmlToReturn += String.Format("<input placeholder='{0}' type='text' class='input-crosslist crosslist-placeholder' id='query' name='filter_number'> <button onclick=\"replacementFNHandler('query', '" + Helpers.XmlHelper.XMLHelper.getLanguageNameById(Convert.ToInt32(this.currentPage.language_id)) + "','" + VirtualPathUtility.ToAbsolute("~/Content/img/ajax-loader.gif") + "')\" type='button' id='querySearchBtn' class='search-crosslist'>&gt;</button>", translationHelper.getTranslation("_repFilterNumber", languageId));
            htmlToReturn += "</div>";
            htmlToReturn += "</div>";
            htmlToReturn += "<div class='col-md-6 col-sm-6 col-xs-12 kat-sub-select mar-top-20'>";
            htmlToReturn += "<div class='  col-xs-12 padding-0' id='multiSearchReplacementsFilterTextInput'>";
            htmlToReturn += String.Format("<input placeholder='{0}' type='text' class='input-crosslist crosslist-placeholder' id='multisearch_filter_numbers_query' name='filter_number'>  <button onclick=\"replacementFNMultisearchHandler('multisearch_filter_numbers_query', '" + Helpers.XmlHelper.XMLHelper.getLanguageNameById(Convert.ToInt32(this.currentPage.language_id)) + "','" + VirtualPathUtility.ToAbsolute("~/Content/img/ajax-loader.gif") + "')\" type='button' id='multisearchBtn' class='search-crosslist'>&gt;</button>", translationHelper.getTranslation("_repMultisearchFilterNumber", languageId));
            htmlToReturn += String.Format("<p id='search-info-multi'>{0}</p>", translationHelper.getTranslation("_repMultisearchFilterNumberInfo", languageId));
            htmlToReturn += "</div>";
            htmlToReturn += "</div>";
            htmlToReturn += "</div>";
            return htmlToReturn;


            //string htmlToReturn = "";


            //htmlToReturn += "<div class=\"col-md-4 col-sm-6  col-xs-12 kat-sub-select mar-top-20\" >";
            //htmlToReturn += "<div class=\" col-sm-6 col-xs-12 padd-l-0 \" id=\"replacementsFilterTextInput\">";
            //htmlToReturn += "<p>" + translationHelper.getTranslation("_repFilterNumber", languageId) + "</p>";
            //htmlToReturn += "</div>";

            //htmlToReturn += "<div class=\"col-sm-6  col-xs-12 padding-0\">";
            //htmlToReturn += "<input id=\"query\" name=\"filter_number\" type=\"text\" class=\"input-crosslist\">  <button onclick=\"replacementFNHandler('query', '" + Helpers.XmlHelper.XMLHelper.getLanguageNameById(Convert.ToInt32(this.currentPage.language_id)) + "','" + VirtualPathUtility.ToAbsolute("~/Content/img/ajax-loader.gif") + "')\" type=\"button\" class=\"search-crosslist\">&gt;</button>";
            //htmlToReturn += "</div>";
            //htmlToReturn += "</div>";




            //htmlToReturn += "<div class=\"col-md-5 col-sm-6  col-xs-12 kat-sub-select mar-top-20\" >";
            //htmlToReturn += "<div class=\" col-sm-6 col-xs-12 padd-l-0 \" id=\"multiSearchReplacementsFilterTextInput\">";
            //htmlToReturn += "<p>" + translationHelper.getTranslation("_repMultisearchFilterNumber", languageId) + "</p>";
            //htmlToReturn += "</div>";

            //htmlToReturn += "<div class=\"col-sm-5  col-xs-12 padding-0\">";
            //htmlToReturn += "<input id=\"multisearch_filter_numbers_query\" name=\"filter_number\" type=\"text\" class=\"input-crosslist\">  <button onclick=\"replacementFNMultisearchHandler('multisearch_filter_numbers_query', '" + Helpers.XmlHelper.XMLHelper.getLanguageNameById(Convert.ToInt32(this.currentPage.language_id)) + "','" + VirtualPathUtility.ToAbsolute("~/Content/img/ajax-loader.gif") + "')\" type=\"button\" class=\"search-crosslist\">&gt;</button>";
            //htmlToReturn += "</div>";
            //htmlToReturn += "</div>";






            /*  
            
           string htmlToReturn = "";
        htmlToReturn += "<div id=\"bottomMenu\">";
           htmlToReturn += "   <div class=\"selectMarketMenu\">";
           htmlToReturn += "       <span class=\"changeMarketInfo\">" + translationHelper.getTranslation("_currentMarketInfoFiltron", languageId) + "</span>";
           htmlToReturn += "       <a href=\"" + translationHelper.getTranslation("_changeMarketLink", languageId) + "\" class=\"changeMarketButton\">" + translationHelper.getTranslation("_changeMarket", languageId) + "</a>";
           htmlToReturn += "   </div>";
           htmlToReturn += "   <ul class=\"selectCarTypeMenu\">";

           htmlToReturn += CatalogueMenuHelper.generateMenuFiltron(languageId, pageId);

           htmlToReturn += "   </ul>"; 
            //</selectCarTypeMenu>

              htmlToReturn += "<div class=\"col-xs-12\" style=\"margin-bottom: 40px;\">";
            //htmlToReturn += "<div id=\"selectCarTypeMenuUnder\">";
            htmlToReturn += "<div class=\"col-md-4 col-sm-6  col-xs-12 kat-sub-select mar-top-20\">";

     htmlToReturn += "<div class=\"col-sm-6  col-xs-12 padd-l-0\">";
                     htmlToReturn +=    "<p>"+ translationHelper.getTranslation("_repFilterNumber", languageId) +"</p>";
                     htmlToReturn += "</div>";
                  htmlToReturn +=            "<div class=\"col-sm-6  col-xs-12 padding-0\">";
                 htmlToReturn +=                " <div class=\"col-xs-12 ajax-loader-select-only\" >";
                  htmlToReturn +=                  "  <img class=\"img-responsive\" src=\"img/ajax-loader.gif\" alt=\"loading\" style=\"  margin: 0 auto; margin-top: 12px;\">";
       
                htmlToReturn +=                  "</div>";
                  htmlToReturn +=               " <input type=\"text\" class=\"input-crosslist\"> <button  type=\"button\" class=\"search-crosslist\">></button>";
htmlToReturn += " </div>";
                htmlToReturn +=       "   </div>";
                 htmlToReturn +=         "<div class=\"col-md-4 col-sm-6    col-xs-12 kat-sub-select mar-top-20\">";
htmlToReturn +=     "   <div class=\"col-sm-6  col-xs-12 padd-l-0\">";
                    htmlToReturn +=           "   <p>"+translationHelper.getTranslation("_repMultisearchFilterNumber", languageId)+"</p>";
                     htmlToReturn +=         "</div>";
                      htmlToReturn +=      "<div class=\"col-sm-6  col-xs-12 padding-0\">";
                     htmlToReturn +=           "<input type=\"text\" class=\"input-crosslist\">  <button  type=\"button\" class=\"search-crosslist\">></button>";
                     htmlToReturn +=  "</div>";
                     htmlToReturn +=  " </div>";
                     htmlToReturn += " </div>";



         /*   htmlToReturn += "<div class=\"selectCarTypeMenuUnderSingle\" id=\"replacementsFilterTextInput\">";
            htmlToReturn += "<label class=\"replacementFNLabel\" for=\"\">" + translationHelper.getTranslation("_repFilterNumber", languageId) + "</label>";
            htmlToReturn += "<input id=\"query\" type=\"text\" style=\"width:154px;\" name=\"filter_number\" />";
            htmlToReturn += "<span style=\"display: block; float: right; background: #1f1b1c; cursor: pointer; height: 22px; padding: 0px 2px 0 4px; text-align: center; color: #fff; margin-right: 5px;\" onclick=\"replacementFNHandler('query', '" + Helpers.XmlHelper.XMLHelper.getLanguageNameById(Convert.ToInt32(this.currentPage.language_id)) + "')\">&raquo;</span>";
            htmlToReturn += "</div>";

            htmlToReturn += "<div style='margin-left: 20px;' class=\"selectCarTypeMenuUnderSingleNoWidth\" id=\"multiSearchReplacementsFilterTextInput\">";
            htmlToReturn += "<span class=\"replacementFNLabel\" for=\"\">" + translationHelper.getTranslation("_repMultisearchFilterNumber", languageId) + "</span>";
            htmlToReturn += "<input id=\"multisearch_filter_numbers_query\" style=\"float:left;\" type=\"text\" name=\"multisearch_filter_numbers\" />";
            htmlToReturn += "<span style=\"display: block; float: left; background: #1f1b1c; cursor: pointer; height: 22px; padding: 0px 2px 0 4px; text-align: center; color: #fff; margin-right: 5px;\" onclick=\"replacementFNMultisearchHandler('multisearch_filter_numbers_query', '" + Helpers.XmlHelper.XMLHelper.getLanguageNameById(Convert.ToInt32(this.currentPage.language_id)) + "')\">&raquo;</span>";
            htmlToReturn += "<span class=\"replacementFNLabel\" for=\"\">" + translationHelper.getTranslation("_repMultisearchFilterNumberInfo", languageId) + "</span>";
            htmlToReturn += "</div>";
          
            htmlToReturn += CatalogueMenuHelper.GenerateLastModifiedFiltron(this.currentPage.language_id);
            htmlToReturn += "</div>"; //</selectCarTypeMenuUnder>
            htmlToReturn += "</div>"; //</bottomMenu>
            htmlToReturn += "<div id=\"contentHolderInner\"><div id=\"ajaxStatementInfo\">" + translationHelper.getTranslation("_replacementAjaxInfo", languageId) + "</div><div id=\"tableContainer\"></div><div id=\"filterContainer\"></div></div>";*/
            //htmlToReturn += "</div> <!-- #contentHolderInner -->"; // #contentHolderInner            
        }

    }
}
